<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>微信授权登陆</title>
    <link rel="stylesheet" type="text/css" href="{{$smarty.const.__APP__}}manage/style/main.css">
    <link rel="stylesheet" href="{{$smarty.const.__APP__}}manage/style/jquery-labelauty.css">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <script src="{{$smarty.const.__APP__}}js/jquery-3.3.1.min.js" type="text/javascript"></script>
    <script src="{{$smarty.const.__APP__}}manage/js/input.js"></script>
    <script type="text/javascript" src="{{$smarty.const.__APP__}}manage/js/rem.js"></script>
    <script src="{{$smarty.const.__APP__}}manage/js/jquery-labelauty.js"></script>
    {{include file="{{$smarty.const.PLUG}}alertUi/alertUi.html"}}
</head>
<body>
    <div class="binding">
        <div class="share">
            <span></span>
            <img src="{{$smarty.const.__APP__}}manage/images/share.png">
        </div>
        <form method="post" onsubmit="return false">
            <div class="success">
                <!-- 输入信息 -->
                <ul class="login_con">
                    <li>
                        <span>姓名：</span>
                        <input type="text" name="username" placeholder="请输入姓名">
                    </li>
                    <li>
                        <span>密码：</span>
                        <input type="password" name="password" placeholder="请输入密码">
                    </li>
                    <li>
                        <span>验证码：</span>
                        <input type="text" name="verify" placeholder="请输入验证码">
                        <img src='{{"index.php?app=Functions&act=getVerifyCode"|URL}}' onclick="this.src=this.src+'?'" style="cursor:pointer">
                    </li>
                </ul>
                <!-- 选择身份 -->
                <ul class="dowebok">
                    <li><input type="radio" name="grade" checked value="1" data-labelauty="普通用户"></li>
                    <li><input type="radio" name="grade" value="0" data-labelauty="管理员"></li>
                </ul>
                <button onclick="login()">确认绑定</button>
                <div class="logo">
                    <img src="{{$smarty.const.__APP__}}manage/images/logo2.png">
                </div>
            </div>
        </form>
    </div>
<script type="text/javascript">
    $(function () {
        $(':input').labelauty();
    })
    //绑定验证
    function login(){
        var params = $("form").serialize();
        $.post('{{"index.php?app=Login&act=oauth"|URL}}',params,function(result){
            if(result.statusCode=='200'){
                ui.success(result.message);
                setTimeout(function(){
                    var url = "{{$smarty.server.REQUEST_URI}}";
                    url = setURLArg(setURLArg(url,'id',result.data.id),'grade',result.data.grade);
                    document.location.href = url;
                },1000);
            }else if(result.statusCode=='300'){
                ui.error(result.message);
            }
        },'json');
    };
</script>
{{include file="Manage/footer.html"}}